<template>
	<div class="child_page">
		<mt-button type="danger" @click="callMethod" size="large">子组件:触发自己的方法</mt-button>
	
	</div>

</template>

<script>
	import {Field,Toast} from 'mint-ui';
	export default {
		components:{Field,Toast},
		data(){
			return{

			}
		},
		mounted(){
			this.$nextTick(()=>{
				const that = this;
				this.$on('childMethod',()=>{
					Toast('监听成功');

					setTimeout(()=>{
						that.callMethod();
					},3000)
				})
			})
		},
		methods:{
			callMethod () {
          		Toast('调用成功')
        	}
		}
	}
</script>

<style scoped>
.child_page{margin-top: 20px;
}
	
</style>